package com.liuche.book.auth.dao.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liuche.book.auth.model.entity.User;

public interface UserMapper extends BaseMapper<User> {
    /**
     * 根据手机号查询用户信息
     * @param phone
     * @return
     */
    default User queryUserInfoByPhone(String phone) {
        LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(User::getPhone, phone);
        return this.selectOne(queryWrapper);
    }
}